package com.java.lesson.lesson5;

public class Test1 {
    static void Test(int a) throws Demo02 {
        if(a>10){
            throw new Demo02(a);//抛出
        }else{
            System.out.println("传递的参数为："+a);
        }
    }

    public static void main(String[] args) {
        try {
            Test(11);
        } catch (Demo02 e) {
            System.out.println("通过catch捕获异常为：" + e);
        }
    }
}
